package cn.lingyangwl.agile.pay.common.manager;

import cn.lingyangwl.framework.tool.core.StringUtils;
import cn.lingyangwl.framework.tool.core.exception.BizException;
import cn.lingyangwl.agile.common.core.exception.enums.GlobalErrorEnum;
import cn.lingyangwl.agile.pay.common.mapper.MchInfoMapper;
import cn.lingyangwl.agile.pay.model.entity.MchInfo;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Component;

import java.util.Objects;

/**
 * @author shenguangyang
 */
@Component
public class MchInfoManager extends ServiceImpl<MchInfoMapper, MchInfo> {
    public void checkExist(String mchNo) {
        if (StringUtils.isEmpty(mchNo) || Objects.isNull(this.getById(mchNo))) {
            throw new BizException(GlobalErrorEnum.OPERATION_FAIL_SELETE);
        }
    }
}
